#ifndef EXCHANGE_DOCUMENT_REFERENCE_H
#define EXCHANGE_DOCUMENT_REFERENCE_H

// #pragma once

#include <memory>
#include <string>
#include <vector>

namespace AMCAX::Exchange
{
        class ExchangeDocumentInstance;
        class ExchangeTopoShape ;

        /// @brief
        class ExchangeDocumentReference
        {
        public:
            ExchangeDocumentReference() = default;

            std::vector<std::shared_ptr<ExchangeDocumentInstance>> GetDirectChildInstances() const;
            void AddChildInstance(std::shared_ptr<ExchangeDocumentInstance> childInstance);
            void RemoveChildInstance(std::shared_ptr<ExchangeDocumentInstance> childInstance);

            bool IsPart() const;
            void SetIsPart(bool isPart);

            std::string GetName() const;
            void SetName(const std::string &name);
            unsigned int GetId() const;
            void SetId(unsigned int id);

            /// @brief This only works when the reference is a part.
            /// @return
            // bool GetPartShape(AMCAX::TopoCompound &topoCompound) const;

            // bool SetPartShape(const AMCAX::TopoCompound &topoCompound);
            bool GetPartShape( std::shared_ptr<ExchangeTopoShape> &topoShape) const;

            bool SetPartShape(const std::shared_ptr<ExchangeTopoShape> &topoShape);

            /// TODO: Not impl.
            bool GetPMIData() const;

        private:
            /// The name of the document
            std::string name_;
            /// The unique id of the document
            unsigned int id_;
            /// The document instance of the reference
            std::vector<std::shared_ptr<ExchangeDocumentInstance>> childInstances_;
            /// Geometry data
            // AMCAX::TopoCompound partTopoCompound_;
            std::shared_ptr<ExchangeTopoShape> topoShape_ ;
            /// Flag to indicate whether the document reference is a part
            bool isPart_ = true;
        };
}

#endif // EXCHANGE_DOCUMENT_REFERENCE_H